<%--@elvariable id="webRoot" type="com.doupi.partner.op.interceptor.OpFilter"--%>
<%--@elvariable id="type" type="com.doupi.partner.op.controller.partner.PartnerController.index"--%>

<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="../common/tags.jsp" %>

<!DOCTYPE html>
<html>
<head lang="en">
    <%@include file="../common/assets.jsp" %>
</head>
<body>
<!-- header -->
<%@include file="../common/header.jsp" %>

<!-- main start -->
<div class="am-cf admin-main">
    <!-- sidebar start -->
    <%@include file="../common/menu.jsp" %>
    <!-- sidebar end -->
    <!-- content start -->
    <div class="admin-content">
        <div class="am-cf am-padding">
            <div class="am-fl am-cf">
                <strong class="am-text-primary am-text-lg">收益管理</strong> /
                <small>${util:getProfitSourceByCode(type).name}</small>
            </div>
        </div>

        <div class="am-g">
            <%--<div class="am-u-sm-12 am-u-md-3">
                <div class="am-input-group">
                    <span class="am-input-group-label">起始时间</span>
                    <input id='begin_date' type="text" class="am-form-field" readonly="readonly">
                </div>
            </div>
            <div class="am-u-sm-12 am-u-md-3">
                <div class="am-input-group">
                    <span class="am-input-group-label">终止时间</span>
                    <input id='end_date' type="text" class="am-form-field" readonly="readonly">
                </div>
            </div>--%> <%--<div class="am-u-sm-12 am-u-md-1">
                <div class="am-input-group">
                    <button type="button" class="am-btn am-btn-secondary"
                            onclick="searchProfit()">查询
                    </button>
                </div>
            </div>--%> <%--<div class="am-u-sm-12 am-u-md-1">
                <div class="am-input-group">
                    <button type="button" class="am-btn am-btn-secondary" onclick="excel()">导出</button>
                </div>
            </div>--%>
            <div class="am-u-sm-12 am-u-md-4"></div>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table width="100%"
                                class="am-table am-table-striped am-table-bordered am-table-compact am-text-nowrap"
                                id="list_table">
                            <thead>
                            <tr>
                                <%--<th>ID</th>--%>
                                <th>金额</th>
                                <%--<th>类型</th>--%>
                                <th>收益时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </form>
                </div>

            </div>
        </div>
    </div>
    <!-- main end -->

    <!-- foot -->
    <%@include file="../common/footer.jsp" %>

    <script type="text/javascript">
        var PROFIT_TABLE;
        $(function () {
            //表格初始化
            PROFIT_TABLE = initDataTable(
                {
                    autoWidth: true,
                    ajax: '${webRoot}/profit/${type}/list',
                    columns: [
                        /*'id',*/
                        'realAmount',
                        'createTime'
                    ]
                }, function () { //搜索参数JSON数据
                    return {
                        /*  beginDate: $('#begin_date').val(),
                         endDate: $('#end_date').val()*/
                    };
                });
            /*初始化日期选择插件*/
            /*$('#begin_date, #end_date').datetimepicker({
             locale: 'zh-CN',
             format: 'YYYY-MM-DD HH:mm:ss',
             showTodayButton: true,
             showClose: true,
             ignoreReadonly: true
             });
             $('#begin_date').on('dp.change', function (e) {
             $('#end_date').data('DateTimePicker').minDate(e.date);
             var newDate = new Date(e.date)
             newDate.setDate(newDate.getDate() + 6);
             $('#end_date').data('DateTimePicker').maxDate(newDate);
             });*/
        });

        /* function excel() {
         window.open('${webRoot}/profit/${type}/excel?beginDate=' + $('#begin_date').val() + '&endDate=' + $('#end_date').val());
         }
         //搜索
         function searchProfit() {
         PROFIT_TABLE.draw();
         }*/

    </script>
</body>
</html>